<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
</head>
<body>
<button id="ok">点一下</button>
<script src="jquery-1.12.4.js"></script>
<script>
    $(function () {
        var serverUrl = "http://122.112.179.240:9005";
        $("#ok").click(function () {
            $.ajax({
                url: serverUrl + "/api/masterData/getDepartment",
                dataType: "json",
                xhrFields: { withCredentials: true },
                success: function (result) {
                    console.log(result);
                },
                error: function (xhr) {
                    console.log(xhr);
                }
            })
        });
    })
</script>
</body>
</html>